feat(sdk): Rotate session keys when a member leaves the room#6292
feat(sdk): Rotate session keys when a member leaves the room#6292
Conversation
d15f1b2 to
11a27af
Compare
11a27af to
f0c2d33
Compare
| let Some(user_id) = client.user_id() else { | ||
| // We aren't logged in, so this shouldn't ever happen. | ||
| return; | ||
| }; |
There was a problem hiding this comment.
I'm tempted to use unwrap here, but I am wary that if any of these assumptions are wrong, this will crash the client entirely.
f0c2d33 to
f0d12dd
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6292 +/- ##
==========================================
- Coverage 89.81% 89.80% -0.02%
==========================================
Files 376 376
Lines 102447 102469 +22
Branches 102447 102469 +22
==========================================
+ Hits 92017 92022 +5
- Misses 6850 6863 +13
- Partials 3580 3584 +4 ☔ View full report in Codecov by Sentry. |
|
@kaylendog in the description of the PR, could you link the issue that explains why we need to do this? |
richvdh
left a comment
There was a problem hiding this comment.
mostly lgtm, a couple of small comments
testing/matrix-sdk-integration-testing/src/tests/e2ee/shared_history.rs
Outdated
Show resolved
Hide resolved
testing/matrix-sdk-integration-testing/src/tests/e2ee/shared_history.rs
Outdated
Show resolved
Hide resolved
testing/matrix-sdk-integration-testing/src/tests/e2ee/shared_history.rs
Outdated
Show resolved
Hide resolved
02f3839 to
177f38a
Compare
richvdh
left a comment
There was a problem hiding this comment.
LGTM otherwise.
I do think it's worth discussing the potential sliding sync a bit further
Not quite sure what you're referring to here.
| /// Test that when a user leaves a room that uses history sharing, the room key | ||
| /// is rotated so they cannot decrypt future messages. |
There was a problem hiding this comment.
This is the same description as test_history_share_on_invite_room_key_rotation. Better add an explanation of the difference.
With EX in particular, sliding sync may mean we don't get all of the state updates that happened while we were offline, which might mean we miss a Regardless of any issues, I don't think they would belong in this PR and can come later. |
Signed-off-by: Skye Elliot <[email protected]>
Signed-off-by: Skye Elliot <[email protected]>
This method is now only used by tests, so I opted to lock it behind the test configuration to appease CI. Signed-off-by: Skye Elliot <[email protected]>
Signed-off-by: Skye Elliot <[email protected]>
Signed-off-by: Skye Elliot <[email protected]>
0a9cc5d to
fd806a9
Compare
If I understand right, in sliding sync, we should get at least one state event for each piece of state that changed inside |
This PR adds an event handler on start that discards (and hence rotates) the current session whenever we see a
leavemembership event.Part of element-hq/element-meta#3078
CHANGELOG.mdfiles.Signed-off-by: Skye Elliot [email protected]